        
<script lang="ts" setup>
const props = defineProps({
    productId: Number,
})
const urlHome = useUrl();


// interface Contract {
//     id: number
//     organization_name: string
//     contract_number: string
//     is_closed: boolean
//     start_date: Date
//     end_date: Date
//     is_active: boolean
// }



interface ContractProduct {
    id: number
    contract: {
        id: number
        organization_name: string
        contract_number: string
        is_closed: boolean
        start_date: Date
        end_date: Date
        is_active: boolean
    }
    oms_full: number
    oms_balance: number
    oms_percent: number
    ob_full: number
    ob_balance: number
    ob_percent: number
    pd_full: number
    pd_balance: number
    pd_percent: number
    product: {
        id: number
        name: string
        measure: string
        warehouse: number
    }
}

const { data: contractProd, execute: getContractProd } = await useFetch<ContractProduct[]>(`${urlHome.value}orders/product_contracts/`, {
    // immediate: false,
    query: {
        product_id: props.productId
    },
    // watch: [productId]
})
</script>
<template>
    <div>
        <div v-for="contract in contractProd">
            <PbStockContract :contractProductId="contract.id" />
        </div>
    </div>
</template>

<style></style>